package com.usian.behavior.controller;

import com.usian.apis.behavior.ApBehaviorEntryControllerApi;
import com.usian.behavior.service.ApBehaviorEntryService;
import com.usian.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/behaviorEntry")
public class ApBehaviorEntryController implements ApBehaviorEntryControllerApi {

    @Autowired
    private ApBehaviorEntryService apBehaviorEntryService;

    /**
     * 根据用户id或设备id 查询用户行为实体
     *
     * @param userId
     * @param equipmentId
     * @return
     */
    @GetMapping("/findByUserIdOrEntryId")
    @Override
    public ApBehaviorEntry findByUserIdOrEntryId(Integer userId, Integer equipmentId) {
        return apBehaviorEntryService.findByUserIdOrEquipmentId(userId,equipmentId);
    }
}
